
var db = require( '../db/db' );
var util = require( 'util' );

const tableName = 'core.admin_region';

exports.getAll = async function () {

    var sql = `SELECT * FROM ${ tableName } WHERE (code % 100) = 0`;
    let params = [];

    try {

        var result = await db.runSql( sql, params );

        if ( result ) {
            return result.rows;
        }

        return null;

    } catch ( e ) {

        console.error( "查询数据行政区分类出错" );
        return null;

    }

};
